package com.example.mylibrarybase.yumengmengtest;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.mylibrarybase.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 35876 于萌萌
 * 创建日期: 21:57 . 2016年11月01日
 * 描述:
 * <p>
 * <p>
 * 备注:
 */

public class Myadapter extends RecyclerView.Adapter {
    private final Context context;
    List<vv> array = new ArrayList<>();
    public Myadapter(Context context, List<vv> array) {
        this.context =context;
        this.array =array;

    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View inflate = View.inflate(context, R.layout.item_item_name, null);

        return new viewiew(inflate);
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        viewiew holder1 = (viewiew) holder;
        TextView list_item_tv_title = (TextView) holder1.itemView.findViewById(R.id.list_item_tv_title);
        list_item_tv_title.setText(array.get(position).name);
    }

    @Override
    public int getItemCount() {
        return array.size();
    }

    class viewiew extends RecyclerView.ViewHolder{

        public viewiew(View itemView) {
            super(itemView);
        }
    }

}
